// JavaScript Document
function MM_changeProp(objId,x,theProp,theValue) { //v9.0
  var obj = null; with (document){ if (getElementById)
  obj = getElementById(objId); }
  if (obj){
    if (theValue == true || theValue == false)
      eval("obj.style."+theProp+"="+theValue);
    else eval("obj.style."+theProp+"='"+theValue+"'");
  }
}

	$(function() {
		$("#part_1_legend").click(function() {
			$('#part_1').toggleClass('closed', 0);
			return false;			
		});
	});
	$(function() {
		$("#upload_legend").click(function() {
			$('#upload').toggleClass('closed', 0);
			return false;			
		});
	});
	$(function() {
		$("#part_2_legend").click(function() {
			$('#part_2').toggleClass('closed', 0);
			return false;			
		});
	});
	$(function() {
		$("#details_legend").click(function() {
			$('#details').toggleClass('closed', 0);
			return false;			
		});
	});
	
	function checkEmail(hoa_consent) {
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('email').value))
		{
			MM_changeProp('warning9','','display','none','P');
			return (true);
		}
		else
		{
			MM_changeProp('warning9','','display','inline','P');
			alert("This is not a valid email address. Please check it.");
			return (false);
		}
	}
	
//	function checkEmailConfirm(hoa_consent) {
//		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('confirm_email').value))
//		{
//			MM_changeProp('warningMatch','','display','none','P');
//			return (true);
//		}
//		else
//		{
//			MM_changeProp('warningMatch','','display','inline','P');
//			alert("This is not a valid email address. Please check it.");
//			return (false);
//		}
//	}	
	
	function checkEmailConfirm(hoa_consent) {
		if (!((document.getElementById('email').value) == "" || (document.getElementById('confirm_email').value) == ""))
		{
			if ((document.getElementById('email').value) == (document.getElementById('confirm_email').value))
			{
				MM_changeProp('warningMatch','','display','none','P');
				return (true);
			}
			else
			{
				MM_changeProp('warningMatch','','display','inline','P');
				alert("Email addresses don't match.");
				return (false);
			}
		}
		else
		{
			MM_changeProp('warningMatch','','display','none','P');
			return true;
		}
	}	
	
	